package cn.edu.scau.cmi.chenmiaopeng.controller.factory;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;

import cn.edu.scau.cmi.chenmiaopeng.factory.simpleFactory.*;
public class SimpleFactoryController {
	@FXML
    private Button confirm;

    @FXML
    private TextArea textarea;

    @FXML
    private ComboBox<String> comboBox;
    
    
    public void clickButton(ActionEvent e) {
		String option =  comboBox.getValue();
		System.out.println("选择的是："+option);
		if(option.equals("please choose meat:")) {
			textarea.appendText("please choose meat you want!\n");
		}
		else {
			Meat meat = MeatFactory.getMeatProduct(option);
			textarea.appendText(meat.meatInfo()+"\n");
		}
	}
}
